#%RAML 1.0
title: API文档
version: v1
baseUri: http://apitest.meifz.com/manage
mediaType: application/json
securitySchemes:
  JWT: !include securitySchemes/jwt.raml
  RBAC: !include securitySchemes/rbac.raml
types:
  ID:
    type: string
    description: 对象ID值
    example: 57e627441bf42a657034cb07
    pattern: ^[0-9a-fA-F]{24}$
  Action: !include types/db/action.json
  Bill: !include types/db/bill.json
  Cat: !include types/db/cat.json
  CatAttr: !include types/db/catAttr.json
  Comment: !include types/db/comment.json
  Coupon: !include types/db/coupon.json
  CouponCharge: !include types/db/couponCharge.json
  CouponExtra: !include types/db/couponExtra.json
  CouponSys: !include types/db/couponSys.json
  Favoriate: !include types/db/favoriate.json
  Income: !include types/db/income.json
  Order: !include types/db/order.json
  OrderLog: !include types/db/orderLog.json
  Product: !include types/db/product.json
  Role: !include types/db/role.json
  Schedule: !include types/db/schedule.json
  ScheduleScheme: !include types/db/scheduleScheme.json
  Shop: !include types/db/shop.json
  Shopcart: !include types/db/shopcart.json
  SmsLog: !include types/db/smsLog.json
  Staff: !include types/db/staff.json
  User: !include types/db/user.json
  UpdateUserInfo: !include types/updateUserInfo.json
  CreateShop: !include types/createShop.json
  UpdateShopInfo: !include types/updateShopInfo.json
  CreateRole: !include types/createRole.json
  RemoveRole: !include types/removeRole.json
  UpdateRoleInfo: !include types/updateRoleInfo.json
  CreateStaff: !include types/createStaff.json
  StaffLogin: !include types/staffLogin.json
  UnfreezeStaff: !include types/unfreezeStaff.json
  UpdateStaffInfo: !include types/updateStaffInfo.json
  CreateAction: !include types/createAction.json
  UpdateActionInfo: !include types/updateActionInfo.json
  CreateRoleAction: !include types/createRoleAction.json
  CreateCouponExtra: !include types/createCouponExtra.json
  UpdateCouponExtraInfo: !include types/updateCouponExtraInfo.json
  CreateCouponCharge: !include types/createCouponCharge.json
  UpdateCouponChargeInfo: !include types/updateCouponChargeInfo.json
  CreateCouponSys: !include types/createCouponSys.json
  UpdateCouponSysInfo: !include types/updateCouponSysInfo.json
  CreateCat: !include types/createCat.json
  Updown: !include types/updown.json
  UpdateCatInfo: !include types/updateCatInfo.json
  CreateCatAttr: !include types/createCatAttr.json
  UpdateCatAttrInfo: !include types/updateCatAttrInfo.json
  CreateProduct: !include types/createProduct.json
  UpdownProduct: !include types/updownProduct.json
  UpdateProductInfo: !include types/updateProductInfo.json
  UpdateProductAttr: !include types/updateProductAttr.json
  CreateOrder: !include types/createOrder.json
  AppointOrder: !include types/appointOrder.json
  DoneOrder: !include types/doneOrder.json
  CancelOrder: !include types/cancelOrder.json
  CreateComment: !include types/createComment.json
  ReplyComment: !include types/replyComment.json
  CreateScheduleScheme: !include types/createScheduleScheme.json
  UpdateScheduleSchemeInfo: !include types/updateScheduleSchemeInfo.json
  UpsertSchedule: !include types/upsertSchedule.json
  UpdateScheduleInfo: !include types/updateScheduleInfo.json
  CreateActive: !include types/createActive.json
  RemoveActives: !include types/removeActives.json
  UpdateActiveInfo: !include types/updateActiveInfo.json
annotationTypes:
  handlerFunc: string
  groupBy: string
  xml: boolean
securedBy: [RBAC]
/users:
  description: 用户列表
  get:
    description: 获取用户列表
    (handlerFunc): listUsers
    (groupBy): user
/user:
  description: 单个用户
  /{userId}:
    uriParameters:
      userId: ID
    delete:
      description: 拉黑用户
      (handlerFunc): removeUser
      (groupBy): user
    /white:
      put:
        description: 用户加入白名单
        (handlerFunc): whiteUser
        (groupBy): user
    /info:
      get:
        description: 获取用户信息
        (handlerFunc): getUserInfo
        (groupBy): user
    /balance:
      get:
        description: 查看账户余额
        (handlerFunc): getBalanceInfo
        (groupBy): bill
/shops:
  description: 店铺列表
  get:
    description: 获取店铺列表
    (handlerFunc): listShops
    (groupBy): shop
/shop:
  description: 店铺
  post:
    description: 新增店铺
    (handlerFunc): createShop
    (groupBy): shop
    body:
      application/json:
        type: CreateShop
        example: !include examples/createShop.req.json
  /{shopId}:
    uriParameters:
      shopId: ID
    delete:
      description: 拉黑店铺
      (handlerFunc): removeShop
      (groupBy): shop
    /info:
      get:
        description: 获取店铺信息
        (handlerFunc): getShopInfo
        (groupBy): shop
      put:
        description: 更新店铺信息
        (handlerFunc): updateShopInfo
        (groupBy): shop
        body:
          application/json:
            type: UpdateShopInfo
            example: !include examples/updateShopInfo.req.json
    /comments:
      description: 评论列表
      get:
        description: 获取评论列表
        (handlerFunc): listComments
        (groupBy): comment
/actions:
  description: 操作列表
  get:
    description: 获取操作列表
    (handlerFunc): listActions
    (groupBy): action
/action:
  description: 后台操作
  post:
    description: 创建操作
    (handlerFunc): createAction
    (groupBy): action
    body:
      application/json:
        type: CreateAction
        example: !include examples/createAction.req.json
  /{actionId}:
    uriParameters:
      actionId: ID
    /info:
      get:
        description: 获取操作信息
        (handlerFunc): getActionInfo
        (groupBy): action
      put:
        description: 更新操作信息
        (handlerFunc): updateActionInfo
        (groupBy): action
        body:
          application/json:
            type: UpdateActionInfo
            example: !include examples/updateActionInfo.req.json
/roles:
  description: 角色列表
  get:
    description: 获取角色列表
    (handlerFunc): listRoles
    (groupBy): role
/role:
  description: 角色
  post:
    description: 创建角色
    (handlerFunc): createRole
    (groupBy): role
    body:
      application/json:
        type: CreateRole
        example: !include examples/createRole.req.json
  /{roleId}:
    uriParameters:
      roleId: ID
    delete:
      description: 禁用角色
      (handlerFunc): removeRole
      (groupBy): role
      body:
        application/json:
          type: RemoveRole
          example: !include examples/removeRole.req.json
    /info:
      get:
        description: 获取角色信息
        (handlerFunc): getRoleInfo
        (groupBy): role
      put:
        description: 更新用户信息
        (handlerFunc): updateRoleInfo
        (groupBy): role
        body:
          application/json:
            type: UpdateRoleInfo
            example: !include examples/updateRoleInfo.req.json
/staffs:
  description: 成员列表
  get:
    description: 获取成员列表
    (handlerFunc): listStaffs
    (groupBy): staff
/staff:
  description: 成员
  post:
    description: 创建成员
    (handlerFunc): createStaff
    (groupBy): staff
    body:
      application/json:
        type: CreateStaff
        example: !include examples/createStaff.req.json
  /unfreeze:
    post:
      description: 清除登录限制
      (handlerFunc): unfreezeStaff
      (groupBy): staff
      body:
        application/json:
          type: UnfreezeStaff
          example: !include examples/unfreezeStaff.req.json
  /login:
    post:
      description: 成员登陆
      (handlerFunc): staffLogin
      (groupBy): staff
      securedBy: [null]
      body:
        application/json:
          type: StaffLogin
          example: !include examples/staffLogin.req.json
  /{staffId}:
    uriParameters:
      staffId: ID
    delete:
      description: 禁用成员
      (handlerFunc): removeStaff
      (groupBy): staff
    /info:
      get:
        description: 获取成员信息
        (handlerFunc): getStaffInfo
        (groupBy): staff
      put:
        description: 更新成员信息
        (handlerFunc): updateStaffInfo
        (groupBy): staff
        body:
          application/json:
            type: UpdateStaffInfo
            example: !include examples/updateStaffInfo.req.json
/couponExtras:
  description: 注册优惠券
  get:
    description: 获取注册优惠券列表
    (handlerFunc): listCouponExtras
    (groupBy): couponExtra
/couponExtra:
  description: 自定义优惠券规则
  post:
    description: 自定义优惠券
    (handlerFunc): createCouponExtra
    (groupBy): couponExtra
    body:
      application/json:
        type: CreateCouponExtra
        example: !include examples/createCouponExtra.req.json
  /{couponExtraId}:
    uriParameters:
      couponExtraId: ID
    delete:
      description: 删除注册优惠券
      (handlerFunc): removeCouponExtra
      (groupBy): couponExtra
    /info:
      get:
        description: 获取自定义优惠券
        (handlerFunc): getCouponExtraInfo
        (groupBy): couponExtra
      put:
        description: 更新充值优惠券模板信息
        (handlerFunc): updateCouponExtraInfo
        (groupBy): couponExtra
        body:
          application/json:
            type: UpdateCouponExtraInfo
            example: !include examples/updateCouponExtraInfo.req.json
/couponCharges:
  description: 充值优惠券模板
  get:
    description: 获取充值优惠券模板列表
    (handlerFunc): listCouponCharges
    (groupBy): couponCharge
/couponCharge:
  description: 充值优惠券
  post:
    description: 创建充值优惠券列表
    (handlerFunc): createCouponCharge
    (groupBy): couponCharge
    body:
      application/json:
        type: CreateCouponCharge
        example: !include examples/createCouponCharge.req.json
  /{couponChargeId}:
    uriParameters:
      couponChargeId: ID
    delete:
      description: 删除充值优惠券模板
      (handlerFunc): removeCouponCharge
      (groupBy): couponCharge
    /info:
      get:
        description: 获取充值优惠券模板信息
        (handlerFunc): getCouponChargeInfo
        (groupBy): couponCharge
      put:
        description: 更新充值优惠券模板信息
        (handlerFunc): updateCouponChargeInfo
        (groupBy): couponCharge
        body:
          application/json:
            type: UpdateCouponChargeInfo
            example: !include examples/updateCouponChargeInfo.req.json
/couponSyses:
  description: 系统发放优惠券列表
  get:
    description: 系统发放优惠券列表
    (handlerFunc): listCouponSyses
    (groupBy): couponSys
/couponSys:
  description: 系统赠送优惠券
  post:
    description: 创建系统赠送优惠券列表
    (handlerFunc): createCouponSys
    (groupBy): couponSys
    body:
      application/json:
        type: CreateCouponSys
        example: !include examples/createCouponSys.req.json
  /{couponSysId}:
    uriParameters:
      couponSysId: ID
    delete:
      description: 删除充值优惠券模板
      (handlerFunc): removeCouponSys
      (groupBy): couponSys
    /info:
      get:
        description: 获取充值优惠券模板信息
        (handlerFunc): getCouponSysInfo
        (groupBy): couponSys
      put:
        description: 更新充值优惠券模板信息
        (handlerFunc): updateCouponSysInfo
        (groupBy): couponSys
        body:
          application/json:
            type: UpdateCouponSysInfo
            example: !include examples/updateCouponSysInfo.req.json
/cats:
  description: 商品类目列表
  /root:
    get:
      description: 获取商品根类目列表
      (handlerFunc): listRootCats
      (groupBy): cat
/cat:
  description: 单个商品类目
  post:
    description: 新增商品类目
    (handlerFunc): createCat
    (groupBy): cat
    body:
      application/json:
        type: CreateCat
        example: !include examples/createCat.req.json
  /{catId}:
    uriParameters:
       catId: ID
    delete:
      description: 删除商品类目
      (handlerFunc): removeCat
      (groupBy): cat
    /updown:
      put:
        description: 类目上下架
        (handlerFunc): updownCat
        (groupBy): cat
        body:
          application/json:
            type: Updown
            example: !include examples/updown.req.json
    /info:
      get:
        description: 获取商品类目信息
        (handlerFunc): getCatInfo
        (groupBy): cat
      put:
        description: 更新商品类目信息
        (handlerFunc): updateCatInfo
        (groupBy): cat
        body:
          application/json:
            type: UpdateCatInfo
            example: !include examples/updateCatInfo.req.json
    /children:
      get:
        description: 获取商品子类目列表
        (handlerFunc): listCatChildrens
        (groupBy): cat
    /products:
      get:
        description: 获取某类目下的产品列表
        (handlerFunc): listProductsByCatId
        (groupBy): product
    /attrs:
      description: 商品属性集列表
      get:
        description: 获取某品类下的属性集列表
        (handlerFunc): listCatAttrs
        (groupBy): catAttr
/attrs:
  description: 商品属性集列表
  delete:
    description: 批量删除属性集
    (handlerFunc): removeCatAttrs
    (groupBy): catAttr
/attr:
  description: 单个商品属性集
  post:
    description: 新增属性集
    (handlerFunc): createCatAttr
    (groupBy): catAttr
    body:
      application/json:
        type: CreateCatAttr
        example: !include examples/createCatAttr.req.json
  /{catAttrId}:
    uriParameters:
      catAttrId: ID
    /info:
      put:
        description: 修改属性集
        (handlerFunc): updateCatAttrInfo
        (groupBy): catAttr
        body:
          application/json:
            type: UpdateCatAttrInfo
            example: !include examples/updateCatAttrInfo.req.json
      get:
        description: 获取属性集信息
        (handlerFunc): getCatAttrInfo
        (groupBy): catAttr
/products:
  description: 产品
  get:
    description: 获取多个产品
    (handlerFunc): listProducts
    (groupBy): product
/product:
  description: 单个产品
  post:
    description: 添加产品
    (handlerFunc): createProduct
    (groupBy): product
    body:
      application/json:
        type: CreateProduct
        example: !include examples/createProduct.req.json
  /{productId}:
    uriParameters:
      productId: ID
    delete:
      description: 删除产品
      (handlerFunc): removeProduct
      (groupBy): product
    /updown:
      put:
        description: 产品上下架
        (handlerFunc): updownProduct
        (groupBy): product
        body:
          application/json:
            type: UpdownProduct
            example: !include examples/updownProduct.req.json
    /info:
      get:
        description: 获取产品信息
        (handlerFunc): getProductInfo
        (groupBy): product
      put:
        description: 修改产品信息
        (handlerFunc): updateProductInfo
        (groupBy): product
        body:
          application/json:
            type: UpdateProductInfo
            example: !include examples/updateProductInfo.req.json
    /attr:
      put:
        description: 修改产品的属性
        (handlerFunc): updateProductAttr
        (groupBy): product
        body:
          application/json:
            type: UpdateProductAttr
            example: !include examples/updateProductAttr.req.json
/orders:
  description: 产品
  get:
    description: 获取多个产品
    (handlerFunc): listOrders
    (groupBy): order
/order:
  description: 单个订单
  post:
    description: 新增订单
    (handlerFunc): createOrder
    (groupBy): order
    body:
      application/json:
        type: CreateOrder
        example: !include examples/createOrder.req.json
  /{orderId}:
    uriParameters:
      orderId: ID
    /info:
      get:
        description: 获取订单信息
        (handlerFunc): getOrderInfo
        (groupBy): order
    /appoint:
      put:
        description: 预约时间
        (handlerFunc): appointOrder
        (groupBy): order
        body:
          application/json:
            type: AppointOrder
            example: !include examples/appointOrder.req.json
    /done:
      put:
        description: 完成订单
        (handlerFunc): doneOrder
        (groupBy): order
        securedBy: [RBAC]
        body:
          application/json:
            type: DoneOrder
            example: !include examples/doneOrder.req.json
    /cancel:
      put:
        description: 取消订单
        (handlerFunc): cancelOrder
        (groupBy): order
        body:
          application/json:
            type: CancelOrder
            example: !include examples/cancelOrder.req.json
/comment:
  description: 评论
  post:
    description: 新增评论
    (handlerFunc): createComment
    (groupBy): comment
    body:
      application/json:
        type: CreateComment
        example: !include examples/createComment.req.json
  /{commentId}:
    uriParameters:
      commentId: ID
    delete:
      description: 删除评论
      (handlerFunc): removeComment
      (groupBy): comment
    /info:
      get:
        description: 获取评论信息
        (handlerFunc): getCommentInfo
        (groupBy): comment
    /review:
      put:
        description: 显示评论
        (handlerFunc): reviewComment
        (groupBy): comment
    /hiden:
      put:
        description: 隐藏评论
        (handlerFunc): hidenComment
        (groupBy): comment
    /reply:
      put:
        description: 回复评论
        (handlerFunc): replyComment
        (groupBy): comment
        securedBy: [RBAC]
        body:
          application/json:
            type: ReplyComment
            example: !include examples/replyComment.req.json
/banner:
  get:
    description: 获取商城首页
    (handlerFunc): getSysBanner
    (groupBy): banner
  put:
    description: 设置商城首页
    (handlerFunc): updateSysBanner
    (groupBy): banner
/scheduleSchemes:
  get:
    description: 获取预约方案列表
    (handlerFunc): listScheduleSchemes
    (groupBy): scheduleScheme
/scheduleScheme:
  description: 预约方案
  post:
    description: 新增预约方案
    (handlerFunc): createScheduleScheme
    (groupBy): scheduleScheme
    body:
      application/json:
        type: CreateScheduleScheme
        example: !include examples/createScheduleScheme.req.json
  /{scheduleSchemeId}:
    uriParameters:
      scheduleSchemeId: ID
    delete:
      description: 删除预约方案
      (handlerFunc): removeScheduleScheme
      (groupBy): scheduleScheme
    /info:
      get:
        description: 获取预约方案信息
        (handlerFunc): getScheduleSchemeInfo
        (groupBy): scheduleScheme
      put:
        description: 修改预约方案信息
        (handlerFunc): updateScheduleSchemeInfo
        (groupBy): scheduleScheme
        body:
          application/json:
            type: UpdateScheduleSchemeInfo
            example: !include examples/updateScheduleSchemeInfo.req.json
/schedules:
  get:
    description: 获取预约时间表
    (handlerFunc): listSchedules
    (groupBy): schedule
/schedule:
  /{scheduleId}:
    uriParameters:
      scheduleId: ID
  #  delete:
  #    description: 删除预约时间
  #    (handlerFunc): removeSchedule
  #    (groupBy): schedule
    /info:
      get:
        description: 获取预约时间信息
        (handlerFunc): getScheduleInfo
        (groupBy): schedule
      put:
        description: 修改预约时间信息
        (handlerFunc): updateScheduleInfo
        (groupBy): schedule
        body:
          application/json:
            type: UpdateScheduleInfo
            example: !include examples/updateScheduleInfo.req.json
/regions:
  get:
    description: 获取地区表
    (handlerFunc): listRegions
    (groupBy): region
    securedBy: [JWT]
/region:
  description: 地区
  /{regionId}:
    uriParameters:
      regionId: ID
    /info:
      get:
        description: 获取地区信息
        (handlerFunc): getRegionInfo
        (groupBy): region
        securedBy: [JWT]
/bills:
  description: 账单列表
  get:
    description: 获取账单列表
    (handlerFunc): listBills
    (groupBy): bill
/bill:
  description: 账单
  /{billid}:
    uriParameters:
      billid: ID
    get:
      description: 获取账单详情
      (handlerFunc): getBillInfo
      (groupBy): bill
/incomes:
  description: 充值单列表
  get:
    description: 获取充值单列表
    (handlerFunc): listIncomes
    (groupBy): income
/income:
  description: 充值单
  /{tradeId}:
    uriParameters:
      tradeId: ID
    get:
      description: 获取充值单详情
      (handlerFunc): getIncomeInfo
      (groupBy): income
/notify:
  description: 到帐通知
  /wechat:
    description: 微信到帐通知
    post:
      description: 微信到帐通知
      (handlerFunc): wechatNotify
      (groupBy): wechat
      (xml): true
      securedBy: [null]
/sms:
  get:
    description: 短信清单
    (handlerFunc): listSMS
    (groupBy): sms
  /templates:
    get:
      description: 短信模板列表
      (handlerFunc): listSMStemplate
      (groupBy): sms
/qiniu:
  description: 七牛
  /token:
    post:
      description: 请求七牛token
      (handlerFunc): requestQiniuToken
      (groupBy): qiniu
/operations:
  get:
    description: 获取后台操作日志
    (handlerFunc): listLogOperations
    (groupBy): logOperation
/actives:
  description: 活动页面模板
  get:
    description: 获取活动页面模板列表
    (handlerFunc): listActives
    (groupBy): active
  delete:
    description: 删除活动页面模板
    (handlerFunc): removeActives
    (groupBy): active
    body:
      application/json:
        type: RemoveActives
        example: !include examples/removeActives.req.json
/active:
  description: 活动页面模板
  post:
    description: 创建活动页面模板
    (handlerFunc): createActive
    (groupBy): active
    body:
      application/json:
        type: CreateActive
        example: !include examples/createActive.req.json
  /{activeId}:
    uriParameters:
      activeId: ID
    /info:
      get:
        description: 获取活动页面模板信息
        (handlerFunc): getActiveInfo
        (groupBy): active
      put:
        description: 更新活动页面模板信息
        (handlerFunc): updateActiveInfo
        (groupBy): active
        body:
          application/json:
            type: UpdateActiveInfo
            example: !include examples/updateActiveInfo.req.json
